package com.atguigu.spzx.product.controller;

import com.atguigu.spyx.model.common.Result;
import com.atguigu.spyx.model.vo.h5.IndexVo;
import com.atguigu.spzx.product.service.ProductService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LT
 * @create 2023-11-17-18:35
 */
@RestController
@RequestMapping("/api/product/index")
//@CrossOrigin(originPatterns = "*" , allowCredentials = "true")
public class IndexController {

    @Resource
    ProductService productService;

    @GetMapping
    public Result index(){
        IndexVo indexVo = productService.findCatesAndSkus();
        return Result.ok().data(indexVo);
    }

}
